package com.example.concurrency.thread03;

/**
 * @description: 测试栈深度
 * @program: demos
 * @author: dove
 * @date: 2020-12-04 00:53
 **/

public class StackSizeTest {

    private static int counter = 0;

    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            @Override
            public void run() {
                try {
                    add(0);
                }catch (Exception e){
                    e.printStackTrace();
                    System.out.println(counter);
                }
            }

            public void add(int i){
                counter++;
                add(i+i);
            }

        },"test",1000000L).start();
    }


}
